<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@include file="../include/base.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">	
	<title>CRM-dealnoteshow</title>
	<%@ include file="../include/head.jsp" %>
	<meta charset="UTF-8">
	<title></title>
	<style type="text/css">
		#user_img{
			display: inline-block;
			background: url(${basePath}/img/workxp_sprites.png) no-repeat -112px 0px transparent; 
			width: 55px; 
			padding-top: 55px;font-size:1px'
		}
	</style>
</head>
<body class="crm">
	<div align="right"> 
	 
	</div>
	<jsp:include page="../include/top.jsp">
		<jsp:param value="deal" name="tag"/>
	</jsp:include>
	
	
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span8">
				<div class="well screen">
					<div class="page-header header">

							

						
	<div class="right-links">
		<a href="dealnoteedit.action?dealnoteid=${dealnote.id }" rel="tooltip" data-original-title="编辑这个事件">编辑</a> 
	</div>

	<a href="show.action?id=${dealnote.deal.id}">${dealnote.deal.title }</a> 的评论
	<span>
		${ dealnote.user.username} 添加
		于 ${dealnote.createtime }
		
	</span>

					</div>
					<div class="live_search_spinner" behavior="spinner" id="parties_loading">
					  <div class="liner">
					    <h3>处理中...</h3>
					    <img src="${basePath }/img/indicator.gif" alt="wait">
					  </div>
					</div>
					<div class="main" id="main">
						


<div class="content">
	<p>${dealnote.content }</p>
</div>




<table class="table top comments" id="comments">
	
<tbody id="tables">
<tr>
	
</tr>
<c:forEach items="${notecommentList }" var="note">
	${note.content }
</c:forEach>
</tbody>
</table>

<table class="table top comments">
	<tbody><tr>
		<td width="65"><span style="display: inline-block;background: url('${basePath }/img/workxp_sprites.png') no-repeat -112px 0px transparent; width: 55px; padding-top: 55px;font-size:1px"></span></td>
		<td>
			<div>
	<!-- <form accept-charset="UTF-8" action="/notes" class="simple_form new_note" data-remote="true" id="note-form" method="post" novalidate="novalidate"> -->
		<input id="from" name="from" type="hidden" value="Note">
		<input id="note_parent_id" name="note[parent_id]" type="hidden" value="817928">
		<input id="note_user_id" name="user.id" type="hidden" value="${dealnote.user.id }">
		<input id="note_deal_id" name="deal.id" type="hidden" value="${dealnote.deal.id }">
		<input id="note_dealnote_id" name="dealnote.id" type="hidden" value="${dealnote.id }">
		
		
		<div class="control-group text required">
			<div class="controls">
				<textarea class="text required content" cols="40" id="note_content" required="required" name="dealnote.content" rows="20"></textarea>
			</div>
		</div>
		

		<div class="new_note_form_basics">
			<div class="submit right">
				<input class="btn btn-primary" data-loading-text="处理中.." id="dealnote_comment" name="commit" type="submit" value="保存">
			</div>
			
		</div>
	<!-- </form> -->
</div>


		</td>
	</tr>
</tbody></table>

<script type="text/javascript">
	$(document).ready(function(){
		$("#dealnote_comment").click(function(){
			
			if($("#note_content").val().trim() != "") {
			
			$.post("savenote.action",
				{"user.id":$("#note_user_id").val(),
				 "deal.id":$("#note_deal_id").val(),
				 "dealnote.id":$("#note_dealnote_id").val(),
				 "dealnote.content":$("#note_content").val()},
				 function(result){
				 	$("#note_content").val("");
					$(result.message).insertBefore($("#tables").children().first());
				 });
			}
		});
	});
	
	function deleteobj(obj) {
		id = $(obj).attr("id");
		$.get("deletenote.action",
			{"dealnote.id":id},
			function(){
				$(obj).parent().parent().parent().parent().remove();
			});
	
	}
</script>














					</div>
				</div>
			</div>
			<div class="span4 sidebar">
				
	<div class="well">
	<div class="title">
		这个事件是关于
	</div>

	<table class="table crm-table top" id="regardings">
			<tbody><tr>
				<td width="36">
					<span style="background: url(${basePath }/img/workxp_sprites.png) no-repeat -222px -162px; width: 32px; padding-top: 32px; border: 1px solid #CCCCCC;" class="sprite"></span>
				</td>
				<td>
					<a href="show.action?id=${dealnote.deal.id}">${dealnote.deal.title }</a>
				</td>
			</tr>
	</tbody></table>
</div>


			</div>
		</div>
	</div>
	
</body>
</html>
